﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace WisDom.Models
{
    /// <summary>
    /// 映射模型
    /// </summary>
    public partial class MappingModel
    {
        private ModelBuilder modelBuilder;
        public MappingModel(ModelBuilder modelBuilder)
        {
            this.modelBuilder = modelBuilder;
        }
        public void ModelCreating()
        {
            AspNetRoleClaimsMapping(modelBuilder);
            CustomizeAspNetRoleClaimsMapping(modelBuilder);

            AspNetRolesMapping(modelBuilder);
            CustomizeAspNetRolesMapping(modelBuilder);

            AspNetUserClaimsMapping(modelBuilder);
            CustomizeAspNetUserClaimsMapping(modelBuilder);

            AspNetUserLoginsMapping(modelBuilder);
            CustomizeAspNetUserLoginsMapping(modelBuilder);

            AspNetUserRolesMapping(modelBuilder);
            CustomizeAspNetUserRolesMapping(modelBuilder);

            AspNetUsersMapping(modelBuilder);
            CustomizeAspNetUsersMapping(modelBuilder);

            AspNetUserTokensMapping(modelBuilder);
            CustomizeAspNetUserTokensMapping(modelBuilder);

            UPChartDetailMapping(modelBuilder);
            CustomizeUPChartDetailMapping(modelBuilder);

            UPChartInfoMapping(modelBuilder);
            CustomizeUPChartInfoMapping(modelBuilder);

            UPDataSourceMapping(modelBuilder);
            CustomizeUPDataSourceMapping(modelBuilder);

            RelationshipsMapping(modelBuilder);
            CustomizeMapping(ref modelBuilder);
        }

        #region AspNetRoleClaims Mapping

        private void AspNetRoleClaimsMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetRoleClaims>().ToTable(@"AspNetRoleClaims", @"dbo");
            modelBuilder.Entity<AspNetRoleClaims>().Property<int>(x => x.Id).HasColumnName(@"Id").HasColumnType(@"int").IsRequired().ValueGeneratedOnAdd();
            modelBuilder.Entity<AspNetRoleClaims>().Property<string>(x => x.ClaimType).HasColumnName(@"ClaimType").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetRoleClaims>().Property<string>(x => x.ClaimValue).HasColumnName(@"ClaimValue").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetRoleClaims>().Property<string>(x => x.RoleId).HasColumnName(@"RoleId").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetRoleClaims>().HasKey(@"Id");
        }

        partial void CustomizeAspNetRoleClaimsMapping(ModelBuilder modelBuilder);

        #endregion

        #region AspNetRoles Mapping

        private static void AspNetRolesMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetRoles>().ToTable(@"AspNetRoles", @"dbo");
            modelBuilder.Entity<AspNetRoles>().Property<string>(x => x.Id).HasColumnName(@"Id").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetRoles>().Property<string>(x => x.ConcurrencyStamp).HasColumnName(@"ConcurrencyStamp").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetRoles>().Property<string>(x => x.Name).HasColumnName(@"Name").HasColumnType(@"nvarchar(256)").ValueGeneratedNever().HasMaxLength(256);
            modelBuilder.Entity<AspNetRoles>().Property<string>(x => x.NormalizedName).HasColumnName(@"NormalizedName").HasColumnType(@"nvarchar(256)").ValueGeneratedNever().HasMaxLength(256);
            modelBuilder.Entity<AspNetRoles>().HasKey(@"Id");
        }

        partial void CustomizeAspNetRolesMapping(ModelBuilder modelBuilder);

        #endregion

        #region AspNetUserClaims Mapping

        private void AspNetUserClaimsMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetUserClaims>().ToTable(@"AspNetUserClaims", @"dbo");
            modelBuilder.Entity<AspNetUserClaims>().Property<int>(x => x.Id).HasColumnName(@"Id").HasColumnType(@"int").IsRequired().ValueGeneratedOnAdd();
            modelBuilder.Entity<AspNetUserClaims>().Property<string>(x => x.ClaimType).HasColumnName(@"ClaimType").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUserClaims>().Property<string>(x => x.ClaimValue).HasColumnName(@"ClaimValue").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUserClaims>().Property<string>(x => x.UserId).HasColumnName(@"UserId").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserClaims>().HasKey(@"Id");
        }

        partial void CustomizeAspNetUserClaimsMapping(ModelBuilder modelBuilder);

        #endregion

        #region AspNetUserLogins Mapping

        private void AspNetUserLoginsMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetUserLogins>().ToTable(@"AspNetUserLogins", @"dbo");
            modelBuilder.Entity<AspNetUserLogins>().Property<string>(x => x.LoginProvider).HasColumnName(@"LoginProvider").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserLogins>().Property<string>(x => x.ProviderKey).HasColumnName(@"ProviderKey").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserLogins>().Property<string>(x => x.ProviderDisplayName).HasColumnName(@"ProviderDisplayName").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUserLogins>().Property<string>(x => x.UserId).HasColumnName(@"UserId").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserLogins>().HasKey(@"LoginProvider", @"ProviderKey");
        }

        partial void CustomizeAspNetUserLoginsMapping(ModelBuilder modelBuilder);

        #endregion

        #region AspNetUserRoles Mapping

        private void AspNetUserRolesMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetUserRoles>().ToTable(@"AspNetUserRoles", @"dbo");
            modelBuilder.Entity<AspNetUserRoles>().Property<string>(x => x.UserId).HasColumnName(@"UserId").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserRoles>().Property<string>(x => x.RoleId).HasColumnName(@"RoleId").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserRoles>().HasKey(@"UserId", @"RoleId");
        }

        partial void CustomizeAspNetUserRolesMapping(ModelBuilder modelBuilder);

        #endregion

        #region AspNetUsers Mapping

        private void AspNetUsersMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetUsers>().ToTable(@"AspNetUsers", @"dbo");
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.Id).HasColumnName(@"Id").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUsers>().Property<int>(x => x.AccessFailedCount).HasColumnName(@"AccessFailedCount").HasColumnType(@"int").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.ConcurrencyStamp).HasColumnName(@"ConcurrencyStamp").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.Email).HasColumnName(@"Email").HasColumnType(@"nvarchar(256)").ValueGeneratedNever().HasMaxLength(256);
            modelBuilder.Entity<AspNetUsers>().Property<bool>(x => x.EmailConfirmed).HasColumnName(@"EmailConfirmed").HasColumnType(@"bit").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<bool>(x => x.LockoutEnabled).HasColumnName(@"LockoutEnabled").HasColumnType(@"bit").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<System.Nullable<System.DateTimeOffset>>(x => x.LockoutEnd).HasColumnName(@"LockoutEnd").HasColumnType(@"datetimeoffset").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.NormalizedEmail).HasColumnName(@"NormalizedEmail").HasColumnType(@"nvarchar(256)").ValueGeneratedNever().HasMaxLength(256);
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.NormalizedUserName).HasColumnName(@"NormalizedUserName").HasColumnType(@"nvarchar(256)").ValueGeneratedNever().HasMaxLength(256);
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.PasswordHash).HasColumnName(@"PasswordHash").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.PhoneNumber).HasColumnName(@"PhoneNumber").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<bool>(x => x.PhoneNumberConfirmed).HasColumnName(@"PhoneNumberConfirmed").HasColumnType(@"bit").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.SecurityStamp).HasColumnName(@"SecurityStamp").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<bool>(x => x.TwoFactorEnabled).HasColumnName(@"TwoFactorEnabled").HasColumnType(@"bit").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<AspNetUsers>().Property<string>(x => x.UserName).HasColumnName(@"UserName").HasColumnType(@"nvarchar(256)").ValueGeneratedNever().HasMaxLength(256);
            modelBuilder.Entity<AspNetUsers>().HasKey(@"Id");
        }

        partial void CustomizeAspNetUsersMapping(ModelBuilder modelBuilder);

        #endregion

        #region AspNetUserTokens Mapping

        private void AspNetUserTokensMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetUserTokens>().ToTable(@"AspNetUserTokens", @"dbo");
            modelBuilder.Entity<AspNetUserTokens>().Property<string>(x => x.UserId).HasColumnName(@"UserId").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserTokens>().Property<string>(x => x.LoginProvider).HasColumnName(@"LoginProvider").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserTokens>().Property<string>(x => x.Name).HasColumnName(@"Name").HasColumnType(@"nvarchar(450)").IsRequired().ValueGeneratedNever().HasMaxLength(450);
            modelBuilder.Entity<AspNetUserTokens>().Property<string>(x => x.Value).HasColumnName(@"Value").HasColumnType(@"nvarchar(max)").ValueGeneratedNever();
            modelBuilder.Entity<AspNetUserTokens>().HasKey(@"UserId", @"LoginProvider", @"Name");
        }

        partial void CustomizeAspNetUserTokensMapping(ModelBuilder modelBuilder);

        #endregion

        #region UPChartDetail Mapping

        private void UPChartDetailMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<UPChartDetail>().ToTable(@"UP_ChartDetail", @"dbo");
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.DetailId).HasColumnName(@"DetailId").HasColumnType(@"varchar(50)").IsRequired().ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.ChartId).HasColumnName(@"ChartId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.ChartType).HasColumnName(@"ChartType").HasColumnType(@"varchar(10)").ValueGeneratedNever().HasMaxLength(10);
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.ExecScript).HasColumnName(@"ExecScript").HasColumnType(@"text").ValueGeneratedNever().HasMaxLength(2147483647);
            modelBuilder.Entity<UPChartDetail>().Property<System.Nullable<System.DateTime>>(x => x.CreateDate).HasColumnName(@"CreateDate").HasColumnType(@"datetime").ValueGeneratedNever();
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.CreateUserId).HasColumnName(@"CreateUserId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.CreateUserName).HasColumnName(@"CreateUserName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartDetail>().Property<System.Nullable<System.DateTime>>(x => x.ModifyDate).HasColumnName(@"ModifyDate").HasColumnType(@"datetime").ValueGeneratedNever();
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.ModifyUserId).HasColumnName(@"ModifyUserId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartDetail>().Property<string>(x => x.ModifyUserName).HasColumnName(@"ModifyUserName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartDetail>().HasKey(@"DetailId");
        }

        partial void CustomizeUPChartDetailMapping(ModelBuilder modelBuilder);

        #endregion

        #region UPChartInfo Mapping

        private void UPChartInfoMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<UPChartInfo>().ToTable(@"UP_ChartInfo", @"dbo");
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.ChartId).HasColumnName(@"ChartId").HasColumnType(@"varchar(50)").IsRequired().ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.ChartName).HasColumnName(@"ChartName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.DataSourceId).HasColumnName(@"DataSourceId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.JsFiles).HasColumnName(@"JsFiles").HasColumnType(@"varchar(200)").ValueGeneratedNever().HasMaxLength(200);
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.Remark).HasColumnName(@"Remark").HasColumnType(@"text").ValueGeneratedNever().HasMaxLength(2147483647);
            modelBuilder.Entity<UPChartInfo>().Property<System.Nullable<System.DateTime>>(x => x.CreateDate).HasColumnName(@"CreateDate").HasColumnType(@"datetime").ValueGeneratedNever();
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.CreateUserId).HasColumnName(@"CreateUserId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.CreateUserName).HasColumnName(@"CreateUserName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().Property<System.Nullable<System.DateTime>>(x => x.ModifyDate).HasColumnName(@"ModifyDate").HasColumnType(@"datetime").ValueGeneratedNever();
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.ModifyUserId).HasColumnName(@"ModifyUserId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().Property<string>(x => x.ModifyUserName).HasColumnName(@"ModifyUserName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPChartInfo>().HasKey(@"ChartId");
        }

        partial void CustomizeUPChartInfoMapping(ModelBuilder modelBuilder);

        #endregion

        #region UPDataSource Mapping

        private void UPDataSourceMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<UPDataSource>().ToTable(@"UP_DataSource", @"dbo");
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.DataSourceId).HasColumnName(@"DataSourceId").HasColumnType(@"varchar(50)").IsRequired().ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.DataSourceName).HasColumnName(@"DataSourceName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPDataSource>().Property<System.Nullable<int>>(x => x.DataSourceType).HasColumnName(@"DataSourceType").HasColumnType(@"int").ValueGeneratedNever();
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.DataSourceAddress).HasColumnName(@"DataSourceAddress").HasColumnType(@"text").ValueGeneratedNever().HasMaxLength(2147483647);
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.Remark).HasColumnName(@"Remark").HasColumnType(@"text").ValueGeneratedNever().HasMaxLength(2147483647);
            modelBuilder.Entity<UPDataSource>().Property<System.Nullable<System.DateTime>>(x => x.CreateDate).HasColumnName(@"CreateDate").HasColumnType(@"datetime").ValueGeneratedNever();
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.CreateUserId).HasColumnName(@"CreateUserId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.CreateUserName).HasColumnName(@"CreateUserName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPDataSource>().Property<System.Nullable<System.DateTime>>(x => x.MofdifyDate).HasColumnName(@"MofdifyDate").HasColumnType(@"datetime").ValueGeneratedNever();
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.ModifyUserId).HasColumnName(@"ModifyUserId").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPDataSource>().Property<string>(x => x.ModifyUserName).HasColumnName(@"ModifyUserName").HasColumnType(@"varchar(50)").ValueGeneratedNever().HasMaxLength(50);
            modelBuilder.Entity<UPDataSource>().HasKey(@"DataSourceId");
        }

        partial void CustomizeUPDataSourceMapping(ModelBuilder modelBuilder);

        #endregion

        private void RelationshipsMapping(ModelBuilder modelBuilder)
        {

            #region AspNetRoleClaims Navigation properties

            modelBuilder.Entity<AspNetRoleClaims>().HasOne(x => x.AspNetRoles).WithMany(op => op.AspNetRoleClaims).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"RoleId");

            #endregion

            #region AspNetRoles Navigation properties

            modelBuilder.Entity<AspNetRoles>().HasMany(x => x.AspNetRoleClaims).WithOne(op => op.AspNetRoles).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"RoleId");
            modelBuilder.Entity<AspNetRoles>().HasMany(x => x.AspNetUserRoles).WithOne(op => op.AspNetRoles).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"RoleId");

            #endregion

            #region AspNetUserClaims Navigation properties

            modelBuilder.Entity<AspNetUserClaims>().HasOne(x => x.AspNetUsers).WithMany(op => op.AspNetUserClaims).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"UserId");

            #endregion

            #region AspNetUserLogins Navigation properties

            modelBuilder.Entity<AspNetUserLogins>().HasOne(x => x.AspNetUsers).WithMany(op => op.AspNetUserLogins).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"UserId");

            #endregion

            #region AspNetUserRoles Navigation properties

            modelBuilder.Entity<AspNetUserRoles>().HasOne(x => x.AspNetRoles).WithMany(op => op.AspNetUserRoles).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"RoleId");
            modelBuilder.Entity<AspNetUserRoles>().HasOne(x => x.AspNetUsers).WithMany(op => op.AspNetUserRoles).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"UserId");

            #endregion

            #region AspNetUsers Navigation properties

            modelBuilder.Entity<AspNetUsers>().HasMany(x => x.AspNetUserClaims).WithOne(op => op.AspNetUsers).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"UserId");
            modelBuilder.Entity<AspNetUsers>().HasMany(x => x.AspNetUserLogins).WithOne(op => op.AspNetUsers).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"UserId");
            modelBuilder.Entity<AspNetUsers>().HasMany(x => x.AspNetUserRoles).WithOne(op => op.AspNetUsers).OnDelete(DeleteBehavior.Cascade).IsRequired(true).HasForeignKey(@"UserId");

            #endregion

            #region UPChartDetail Navigation properties

            modelBuilder.Entity<UPChartDetail>().HasOne(x => x.UPChartInfo).WithMany(op => op.UPChartDetail).IsRequired(false).HasForeignKey(@"ChartId");

            #endregion

            #region UPChartInfo Navigation properties

            modelBuilder.Entity<UPChartInfo>().HasMany(x => x.UPChartDetail).WithOne(op => op.UPChartInfo).IsRequired(false).HasForeignKey(@"ChartId");
            modelBuilder.Entity<UPChartInfo>().HasOne(x => x.UPDataSource).WithMany(op => op.UPChartInfo).IsRequired(false).HasForeignKey(@"DataSourceId");

            #endregion

            #region UPDataSource Navigation properties

            modelBuilder.Entity<UPDataSource>().HasMany(x => x.UPChartInfo).WithOne(op => op.UPDataSource).IsRequired(false).HasForeignKey(@"DataSourceId");

            #endregion
        }

        partial void CustomizeMapping(ref ModelBuilder modelBuilder);

    }
}
